<?php
namespace app\base\controller;

class Cstatic
{


    //全局静态变量
    private static $overall = [];
    private static $instance;

    /**
     * 初始化
     * @access public
     * @param array $options 参数
     * @return \think\Request
     */
    public static function instance($options = [])
    {
        if (is_null(self::$instance)) {
            self::$instance = new static($options);
        }
        return self::$instance;
    }

    public  static function set($key,$val){
                self::$overall[$key] = $val;
    }

    public  static function get($key){
                    if(isset(self::$overall[$key])){
                                return self::$overall[$key];
                    }
                    return false;
    }

    public  static function has($key){
                    return isset(self::$overall[$key])?true:false;
    }

    public  static function del($key){
        if(isset(self::$overall[$key])){
                    unset(self::$overall[$key]);
                    return true;
        }
        return false;
    }

}
